/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jili.ubert.code.server2client;

import com.baidu.bjf.remoting.protobuf.Codec;
import com.baidu.bjf.remoting.protobuf.ProtobufProxy;
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
import com.jili.ubert.code.CodeTool;
import java.io.IOException;

/**
 *
 * @author dragon
 */
public class SystemMessage {
    
    public static byte[] EnCode(SystemMessage msg) throws IOException {
        Codec<SystemMessage> Lcode = ProtobufProxy.create(SystemMessage.class);
        return Lcode.encode(msg);
    }

    public static SystemMessage DeCode(byte[] data) throws IOException {
        Codec<SystemMessage> Lcode = ProtobufProxy.create(SystemMessage.class);
        return Lcode.decode(data);
    }
    @Protobuf
    private String subject;
    @Protobuf
    private int code;
    @Protobuf
    private byte[] contentBit;
    private String content;

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public byte[] getContentBit() {
        return contentBit;
    }

    public void setContentBit(byte[] contentBit) {
        this.contentBit = contentBit;
        this.contentBit = CodeTool.StringToBit(subject);
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
        this.contentBit = CodeTool.StringToBit(content);
    }
}
